package com.wuba.rxjavademo.tzx.filter;

import com.wuba.rxjavademo.tzx.common.Base;

import rx.Observable;

/**
 * Created by tanzhenxing
 * Date: 2016/6/27.
 * Description:
 * take()函数用整数N来作为一个参数，从原始的序列中发射前N个元素
 */
public class RxTake extends Base {
    public static void main(String [] args) {
        RxTake take = new RxTake();
        take.run();
    }

    @Override
    public void run() {
        Observable.from(items)
                .take(30)
                .subscribe(Base::print);
    }
}
